package com.smartcruise.service;

import android.os.Handler;
import android.os.Message;

import com.smartcruise.util.network.DataAutoUpload;

/**
 * Created by FengChaoQun
 * on 2018/3/6 0006
 * 处理定时任务的handler
 * 通知{@link DataAutoUpload}检查并上传数据
 */

public class TimerHandler extends Handler {

    public static final int timer = 1;
    public static final int expired = 2;

    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);
        switch (msg.what) {
            case timer:
                DataAutoUpload.getInstance().start();
                break;
//            case expired:
//                MyApplication.getInstance().showExpiredDialog();
//                break;
        }

    }

    private TimerHandler() {

    }

    static class InstanceHolder {
        final static TimerHandler instance = new TimerHandler();
    }

    public static TimerHandler getInstance() {
        return InstanceHolder.instance;
    }
}
